-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LG 11140 Break up webauthn selection presenter #9467
LG 11140 Break up webauthn selection presenter #9467
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Couple minor comments
def method | ||
:webauthn_platform | ||
end | ||
|
||
def initialize(user:, configuration: nil) | ||
@user = user | ||
@configuration = configuration | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest reordering these methods so that the constructor is first.
def method | |
:webauthn_platform | |
end | |
def initialize(user:, configuration: nil) | |
@user = user | |
@configuration = configuration | |
end | |
def initialize(user:, configuration: nil) | |
@user = user | |
@configuration = configuration | |
end | |
def method | |
:webauthn_platform | |
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got that reordered.
@@ -1,5 +1,5 @@ | |||
module TwoFactorAuthentication | |||
class WebauthnPlatformSelectionPresenter < SelectionPresenter | |||
class SignInWebauthnPlatformSelectionPresenter < SelectionPresenter | |||
def method | |||
:webauthn_platform | |||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove checks below to configuration.blank?
, since I would expect that the configuration should never be blank in the "Sign in" classes. They should be replaced with false
.
3069918
to
4d2be38
Compare
4d2be38
to
3c30b5d
Compare
it 'raises with missing translation' do | ||
expect(presenter.label).to eq( | ||
t('two_factor_authentication.two_factor_choice_options.webauthn_platform'), | ||
) | ||
end | ||
end | ||
|
||
describe '#info' do | ||
it 'raises with missing translation' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed these as I start work on a related ticket. These methods don't raise, so I think we should revise the expectation description accordingly.
it 'raises with missing translation' do | |
expect(presenter.label).to eq( | |
t('two_factor_authentication.two_factor_choice_options.webauthn_platform'), | |
) | |
end | |
end | |
describe '#info' do | |
it 'raises with missing translation' do | |
it 'returns the label text' do | |
expect(presenter.label).to eq( | |
t('two_factor_authentication.two_factor_choice_options.webauthn_platform'), | |
) | |
end | |
end | |
describe '#info' do | |
it 'returns the info text' do |
This reverts commit ccb2192.
@@ -17,19 +17,6 @@ | |||
end | |||
end | |||
|
|||
describe '#render_in' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we lost test coverage here, we still have a SetUpWebauthnSelectionPresenter#render_in
method.
🎫 Ticket
LG-11140
🛠 Summary of changes
Split up Webauthn & Webauthn Platform presenters into Sign Up and Sign In classes as a follow up to #9211
📜 Testing Plan
Adding Security key and Face or touch unlock MFA should continue to work as expected. Sign in with Security key or Face or touch unlock MFA should continue to work as expected.